package com.water.app;
public class LoginInfo {
    private int id;
    private String username;
    private String token;
    private int isManager;

    public int getIsManager(){
        return this.isManager;
    }

    public void setIsManager(int isManager){
        this.isManager=isManager;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public LoginInfo(int id,String username, String token,int isManager) {
        this.id=id;
        this.username = username;
        this.token = token;
        this.isManager=isManager;
    }

    public LoginInfo() {}

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public static Builder builder(){
        return new Builder();
    }

    public static final class Builder{
        int id;
        String username;
        String token;
        int isManager;
        private Builder(){}

        public Builder setId(int id){
            this.id=id;
            return this;
        }

        public Builder setUserName(String username){
            this.username=username;
            return this;
        }

        public Builder setToken(String token){
            this.token=token;
            return this;
        }

        public Builder setIsManager(int isManager){
            this.isManager=isManager;
            return this;
        }



        public LoginInfo build(){
            if(username==null||username.isEmpty()){
                username="";
            }
            if(token==null||token.isEmpty()){
                token="";
            }
            return new LoginInfo(id,username,token,isManager);
        }
    }
}
